Skip to content

[WIP] ComponentPath and ChannelPath properties for Sockets and Inputs. #1489

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

chrisdembia
Copy link
Member

@chrisdembia chrisdembia commented Jan 25, 2017

@aseth1 , @klshrinidhi and I just chatted about changes I had initiated to convert the property within Sockets and Inputs to use ComponentPath and ChannelPath instead of std::string. The primary goal of these changes for 4.0 is to help fix bug #1420, but the changes also provide substantial cleanup of the code. The plan is for @klshrinidhi to finish this PR by tackling the tasks listed below, to get this PR merged, and then to fix #1420 in a separate pull request. If finishing these changes takes too long, then we should just fix #1420 the quick way and finish these changes after 4.0.

To-do list:

  • Write documentation for the ChannelPath class.
  • Some simple python/MATLAB tests to make sure it's easy to use ComponentPath/ChannelPath with Component methods (e.g., Component::getRelativePath()).
  • Get rid of AbstractSocket::checkConnecteeNameProperty(); error checks should now occur in the deserialization code in Property.h (readSimplePropertyFromStream()).
  • Create a base class for Sockets and Inputs whose template argument is the property type (either ComponentPath or ChannelPath); this base class would have string-based methods like setConnecteePath(std::string) and appendConnecteePath(std::string).
  • Create new methods on AbstractSocket and AbstractInput that use the path type (e.g., setConnecteePath(ComponentPath)), and use these in Input::findAndConnect(), etc.
  • Get rid of the AbstractSocket constructor that takes isList as an argument; this should be obtained by the new base Connector by asking the property if it is a list (I can clarify this in person).
  • Decide if Channel::getPathName() is unnecessary (replaced by getAbsolutePath() and getRelativePath()) and if so, delete it.
  • Properly handle errors within operator>>(std::istream& in, ComponentPath&)
  • Remove the parseConnecteeName() helper function, and related tests.

@klshrinidhi please feel free to chat with me about these changes.

See the branch ComponentPath_property_sandbox for my first shot at rearranging the class hierarchy for Sockets and Inputs.


This change is Reviewable

This fixes an issue where a default-constructed ComponentPath would have
garbage values for Path::_separator and Path::_isAbsolute (the default Path
constructor did not initialize these members).
The move to ChannelPath is functional, but in a very intermediate state.
@klshrinidhi klshrinidhi changed the title ComponentPath and ChannelPath properties for Sockets and Inputs. [WIP] ComponentPath and ChannelPath properties for Sockets and Inputs. Jan 25, 2017
@klshrinidhi klshrinidhi self-assigned this Jan 25, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Input::setAlias is not reflected in TableReporter, etc.
2 participants